

/* PROGRAM TO COMPUTE THE REJECTION RATES AND ECV */

ITRmax=1000;
Jmax=15;

/* ITR~PV1~PV2~PV3~PV4~PV5~PV6~ACVPV~STAT0 */
/* 7 tests */

load data[ITRmax,1+(6+1+1)*7*(Jmax+3)]=c:\gauss8.0\myout\MD_S100_100.dat;

data1=data[.,1+1:1+(6+1)*7*(Jmax+3)];
data2=data[.,1+(6+1)*7*(Jmax+3)+1:1+(6+1+1)*7*(Jmax+3)];


REJ10=meanc((data1.<0.10));
REJ05=meanc((data1.<0.05));
REJ01=meanc((data1.<0.01));

REJ=REJ10~REJ05~REJ01;

QINDEX=zeros(Jmax+3,1);
q=1;
do until q==(Jmax+3)+1;
data2[.,q]=sortc(data2[.,q],1);
Qindex[q]=q;
q=q+1;
endo;

Tindex0=ones(Jmax+3,1);

/* 7 times is due to 7 tests */
Tindex0=(1*Tindex0)|(2*Tindex0)|(3*Tindex0)|(4*Tindex0)|(5*Tindex0)|(6*Tindex0)|(7*Tindex0);

/* 7 times is due to 7 methods to compute p-values */

Tindex1=Tindex0|Tindex0|Tindex0|Tindex0|Tindex0|Tindex0|Tindex0;

/* 7 times is due to 7 tests */
Qindex0=Qindex|Qindex|Qindex|Qindex|Qindex|Qindex|Qindex;

/* 7 times is due to 7 methods to compute p-values */

Qindex1=Qindex0|Qindex0|Qindex0|Qindex0|Qindex0|Qindex0|Qindex0;

ECV10=data2[0.90*ITRmax,.]';
ECV05=data2[0.95*ITRmax,.]';
ECV01=data2[0.99*ITRmax,.]';

ECV=ECV10~ECV05~ECV01;

output file=c:\gauss8.0\myout\MD_S100.rej on;
Tindex1~Qindex1~REJ;
output off;

output file=c:\gauss8.0\myout\MD_S100.ECV on;
Tindex0~Qindex0~ECV;
output off;
